package com.czxy.tanhua.vo;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * @Author 爱吃豆的土豆、
 * @Date 2023/4/12 22:01
 */
@Data
@NoArgsConstructor
public class CommentVo implements Serializable {
    private String id;
    private String avatar;
    private String nickname;
    private String content;
    private String createDate;
    private Integer likeCount;
    private Integer hasLiked;

    public CommentVo(String id, String avatar, String nickname, String content, String createDate, Integer likeCount, Integer hasLiked) {
        this.id = id;
        this.avatar = avatar;
        this.nickname = nickname;
        this.content = content;
        //处理时间
        Date date = new Date();
        date.setTime(Long.parseLong(createDate));
        this.createDate = date.toLocaleString();
        this.likeCount = likeCount;
        this.hasLiked = hasLiked;
    }
}
